package com.rgp.apipassenger.controller;

import com.rgp.apipassenger.response.PassengerInfoResponse;
import com.rgp.apipassenger.service.PassengerUserService;
import com.rgp.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author nhp
 * @version 1.0
 * @description TODO
 * @date 2024-04-13 19:42
 */
@RestController
public class PassengerUserController {

    @Autowired
    private PassengerUserService passengerUserService;

    @GetMapping("/users")
    public ResponseResult getPassengerInfo(@RequestHeader("authorization") String accessToken){
        //根据乘客携带的token获取其个人信息
        PassengerInfoResponse response = passengerUserService.getPassengerInfo(accessToken);
        return ResponseResult.success(response);
    }
}